/*    */ package tools.packet;
/*    */ 
/*    */ import handling.opcode.SendPacketOpcode;
/*    */ import java.util.Map;
/*    */ import server.MapleSignin;
/*    */ import tools.data.output.MaplePacketLittleEndianWriter;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SigninPacket
/*    */ {
/*    */   public static byte[] showSigninUI() {
/* 16 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*    */     
/* 18 */     mplew.writeShort(SendPacketOpcode.SIGIN_INFO.getValue());
/*    */     
/* 20 */     mplew.write(0);
/* 21 */     mplew.write(SIGNIN_TYPE.签到窗口.ordinal());
/* 22 */     mplew.writeLong(PacketHelper.getTime(-2L));
/* 23 */     mplew.writeLong(PacketHelper.getTime(-1L));
/* 24 */     mplew.writeInt(MapleSignin.getInstance().getSiginRewards().size());
/* 25 */     mplew.writeInt(2);
/* 26 */     mplew.writeInt(16700);
/* 27 */     mplew.writeInt(300);
/* 28 */     mplew.writeInt(MapleSignin.getInstance().getSiginRewards().size());
/*    */     
/* 30 */     for (MapleSignin.SiginRewardInfo rewardInfo : MapleSignin.getInstance().getSiginRewards()) {
/* 31 */       mplew.writeInt(rewardInfo.getRank());
/* 32 */       mplew.writeInt(rewardInfo.getItemId());
/* 33 */       mplew.writeInt(rewardInfo.getQuantity());
/* 34 */       mplew.writeInt((rewardInfo.getExpiredate() > 0) ? 1 : 0);
/* 35 */       mplew.writeLong((rewardInfo.getExpiredate() > 0) ? (rewardInfo.getExpiredate() * 24 * 60) : 0L);
/* 36 */       mplew.write(0);
/* 37 */       mplew.write(0);
/* 38 */       mplew.writeInt(0);
/*    */     } 
/*    */     
/* 41 */     mplew.writeInt(33);
/* 42 */     mplew.writeInt(MapleSignin.getInstance().getUnknownMap().size());
/* 43 */     for (Map.Entry<Integer, Integer> integerEntry : (Iterable<Map.Entry<Integer, Integer>>)MapleSignin.getInstance().getUnknownMap().entrySet()) {
/* 44 */       mplew.writeInt(((Integer)integerEntry.getKey()).intValue());
/* 45 */       mplew.writeInt(((Integer)integerEntry.getValue()).intValue());
/*    */     } 
/* 47 */     mplew.writeInt(0);
/* 48 */     mplew.writeInt(0);
/* 49 */     return mplew.getPacket();
/*    */   }
/*    */   
/*    */   public static byte[] getSigninReward(int itemid) {
/* 53 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*    */     
/* 55 */     mplew.writeShort(SendPacketOpcode.SIGIN_INFO.getValue());
/*    */     
/* 57 */     mplew.write(1);
/* 58 */     mplew.writeInt(SIGNIN_TYPE.领取奖励.ordinal());
/* 59 */     mplew.writeInt(itemid);
/*    */     
/* 61 */     return mplew.getPacket();
/*    */   }
/*    */   
/*    */   public static byte[] getSigninReward(int itemid, int type) {
/* 65 */     return getSigninReward(itemid, type, 0);
/*    */   }
/*    */   
/*    */   public static byte[] getSigninReward(int itemid, int type, int time) {
/* 69 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*    */     
/* 71 */     mplew.writeShort(SendPacketOpcode.SIGIN_INFO.getValue());
/* 72 */     mplew.write(SIGNIN_TYPE.领取奖励.ordinal());
/* 73 */     mplew.writeInt(type);
/* 74 */     mplew.writeInt(itemid);
/* 75 */     if (type == 14) {
/* 76 */       mplew.writeInt(time);
/*    */     }
/* 78 */     return mplew.getPacket();
/*    */   }
/*    */   
/*    */   enum SIGNIN_TYPE {
/* 82 */     UNKNOWN,
/* 83 */     签到窗口,
/* 84 */     领取奖励;
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\tools\packet\SigninPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */